home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Your Choice 1
/
your choice.zip
/
your choice
/
PRGMMING
/
MOUDESIG
/
MDESIGN.DOC
< prev
next >
Wrap
Text File
|
1993-04-20
|
40KB
|
1,009 lines
╓ ╓ ───────── ╓─╥ ─────────────────── ╓─╥ ──────────────────────────┐
║ ║ N I T E D ╟─╜ R O G R A M M E R S ║ L U B Feitelijke │
┌─── ╨─╜ ───────── ╜ ───────────────────── ╨─╜ ───── Vereniging │
│ │
│ │
│ Kent u de United Programmers Club ? │
│ │
│ De United Programmers Club (kortweg UPC) is een vereniging voor pro- │
│ grammerende gebruikers van IBM compatibele computers. Het doel van │
│ de UPC is programmeurs te ondersteunen en hulp te bieden, en hen op │
│ de hoogte te houden van de nieuwigheden op het vlak van programmeren. │
│ │
│ Dit alles is gebaseerd op uitwisselingen tussen de leden. Deze uit- │
│ wisselingen worden aangemoedigd door het houden van bijeenkomsten, en │
│ door het uitgeven van een ledenblad. ┌──────────────────────────────╖ │
│ Daarnaast zorgt een boeken en tijd- │ Voor info, schrijf naar: ║ │
│ schriften bibliotheek voor naslag- │ ║ │
│ werken. De softwarebibliotheek biedt │ UNITED PROGRAMMERS CLUB ║ │
│ u programmeertools en compilers. │ POSTBUS 40 ║ │
│ │ B-1090 BRUSSELS ║ │
│ Schrijf ons gerust om informatie !!! │ BELGIUM ║ │
│ ╘══════════════════════════════╝ │
└────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────
M O U S E D E S I G N E R 1.0
────────────────────────────────────────────────────────────────
M O U S E D E S I G N E R v e r s i o n 1 . 0
(C) Copyright 1993 Rudi Breedenraedt
FREEWARE
UNITED PROGRAMMERS CLUB
TAV. RUDI BREEDENRAEDT
POSTBUS 40
B-1090 BRUSSELS
BELGIUM April 1993.
────────────────────────────────────────────────────────────────
M O U S E D E S I G N E R 1 . 0
M A N U A L
────────────────────────────────────────────────────────────────
C O N T E N T S
1. WHAT IS MOUSE DESIGNER ? 2
2. SYSTEM REQUIREMENTS 3
3. STARTING WITH MOUSE DESIGNER 4
3.1 drawing mouse arrows 4
3.2 testing the drawed mouse arrow 4
3.3 loading mouse arrows from disk 5
3.3.1 clearing the grid 5
3.4 saving mouse arrows to disk 5
3.4.1 the temporary file format 6
3.4.2 *.TXT file format 6
3.4.3 > PRN : redirect to printer 6
4. COMMANDLINE OPTIONS 7
5. ADVANCED FEATURES 8
5.1 mirror 8
5.2 turn 90° 8
6. USING MOUSE DESIGNER PROCEDURES 9
6.1 in Quick-BASIC 9
6.2 in Turbo PASCAL 10
6.3 in C 10
6.4 in assembly 10
6.5 other programming languages 11
7. DESCRIPTION OF FILE-FORMATS 12
7.1 the *.MOU format 12
7.2 the *.COM format 12
8. MORE ABOUT... 14
8.1 using mouse control into your programs 14
8.2 defining graphical mouse arrow shapes 17
9. FREEWARE, SOURCECODE, UPGRADE, CONTACTING AUTHOR 19
10. THANKS TO... 20
┌┤DISCLAIMER├──────────────────────────────────────────────────┐
│MOUSE DESIGN IS PROVIDED "AS IS", THIS MEANS THAT THE AUTHOR │
│IS NOT RESPONSIBLE FOR EVENTUAL ERRORS (BUGS) IN THE PROGRAM. │
│IF YOU USE MOUSE DESIGN YOU AGREE WITH THIS RULE. │
└──────────────────────────────────────────────────────────────┘
Sorry, I know my English is awfull...
MDESIGN 1.0 Manual page 02
────────────────────────────────────────────────────────────────
C H A P T E R 1
1. WHAT IS MOUSE DESIGNER ?
------------------------
Mouse Designer is a programming tool for programmers in
Microsoft QuickBASIC 4.5+, Borland Turbo PASCAL 5.0+, Turbo C,
Microsoft Macro Assembler 6.0+,...
Mouse Designer lets you design on an easy, interactive way
graphical mouse arrows for use in your own software. When saving
the mouse arrow, you can select different file formats:
- M_DESIGNER (a special format for Mouse Designer)
- *.TXT (a textual picture of the mouse arrow)
- *.BAS (a QuickBASIC subroutine)
- *.PAS (a Turbo Pascal unit)
- *.H (a C header file)
- *.ASM (a MASM procedure)
- *.COM (a COM file to set the mouse arrow)
- > PRN (redirect a textual picture of the mouse to printer)
Note: mouse arrows can only be loaded from the M_DESIGN format.
The Mouse Designer package contains MDESIGN.EXE (the main
program), some *.MOU example files, three QuickBASIC
demonstration programs (MDEMO1.BAS to MDEMO3.BAS) and a mouse
grabber (MGRAB.COM).
MDESIGN 1.0 Manual page 03
────────────────────────────────────────────────────────────────
C H A P T E R 2
2. SYSTEM REQUIREMENTS
-------------------
To use Mouse Designer you need - of course - a mouse and the
mouse driver MOUSE.COM or any equivalent mouse driver. You need
also a computer with at least 200K of free low memory. A VGA
color monitor is also required (EGA color monitors with more
than 64K memory will also suit).
Note: Many non-Microsoft-mouse-drivers (Logitech drivers, Agiler
drivers, Genius drivers,...) are not fully compatible with
Microsoft's MOUSE.COM. Mouse Designer works properly with
Microsoft's MOUSE.COM verion 7.03. If troubles occures using
the mouse, try another mouse driver.
MDESIGN 1.0 Manual page 04
────────────────────────────────────────────────────────────────
C H A P T E R 3
3. STARTING WITH MOUSE DESIGNER
----------------------------
First you have to install MOUSE.COM.
Then, just start MDESIGN.EXE from the DOS prompt. You will see a
screen with on the left side a grid wherein you can design your
own graphical mouse arrows. On the right side you will have some
boxes 'INPUT', 'OUTPUT', 'DEMO', etc. This are options you can
select by clicking with the mouse arrow on it. On the bottom you
will see 16 colored rectangles.
3.1. DRAWING MOUSE ARROWS
Ones MDESIGN.EXE is loaded, you cannot immediatly start drawing
mouse arrows in the grid using the mouse.
You will first have to select in which 'color' you want to draw.
Indeed, the mouse graphic can have 4 different attributes:
white, black, background and inversed background. To select a
color, just pres F1, F2, F3 or F4. You can also select a color
by clicking the mouse in the middle box on the selected color.
Ones a color is selected, you can draw using the left mouse
button to draw in the selected color, or the right mouse button
to draw in background color. (The middle mouse button is not
supported.)
3.2. TESTING THE DRAWED MOUSE ARROW
Ones you have designed an own mouse arrow, we suggest you should
test it on different backgrounds to see if the arrow is visible
on all those backgrounds. Click therefore with the mouse on the
'DEMO' box. The mouse arrow will now change into what you have
drawed. Go with the mouse arrow in the sixteen colored boxes on
the bottom of the screen to test them.
To end the DEMO mode, press ESCape. The mouse arrow will now
return to its original form and you can continue drawing the
mouse arrow.
MDESIGN 1.0 Manual page 05
────────────────────────────────────────────────────────────────
3.3. LOADING MOUSE ARROWS FROM DISK
To load a mouse arrow from disk, click with the mouse on 'INPUT'
and the select a 'file format'. There are 3 file formats
available:
- TEMP (temporary files, see 3.4.1)
- M_DESIGNER (the standard file format)
- _CLEAR (see: 3.3.1. CLEARING THE GRID)
Select M_DESIGNER (by clicking twice on it) and type in the name
of the mouse arrow to load.
3.3.1. CLEARING THE GRID
To clear the mouse arrow grod, just select 'INPUT' and '_CLEAR'
(clicking twice). The grid will now be cleared.
3.4. SAVING MOUSE ARROWS TO DISK
The designed mouse arrow can also be saved to different file
formats:
- TEMP (temporary files, see 3.4.1)
- M_DESIGNER (Mouse Designs standard file format)
- *.TXT (a textual picture of the mouse arrow)
- *.BAS (a QuickBASIC subroutine)
- *.PAS (a Turbo Pascal unit)
- *.H (a C header file)
- *.ASM (a MASM procedure)
- *.COM (a COM file to set the mouse arrow)
- > PRN (redirect a textual picture of the mouse to printer)
Fore how to use the created files in your own software, see the
chapter 'USING MOUSE DESIGNER PROCEDURES' (chapter 6).
Note 1: save always your mouse arrows to the M_DESIGNER format,
it's the only way to reload them into Mouse Designer !
Note 2: > PRN does not save a file, but sends a textual picture
of the mouse arrow to printer.
Note 3: when typing a filename, you can only type in 8 chars for
the filename. The file will be saved in the active directory. Do
not type an extension, Mouse Designer automatically adds the
required extension to the filename.
MDESIGN 1.0 Manual page 06
────────────────────────────────────────────────────────────────
3.4.1. THE TEMPORARY FILE FORMAT
When drawing the mouse arrow, you can regularly save the mouse
arrow to the file TEMP.MOU. Therefore, just select TEMP in the
'OUTPUT' menu. You don't have to type a filename. But note, that
everytime you saves a temporary file, the old TEMP.MOU is
erased, so be carefull !
You can reload TEMP.MOU be selecting TEMP in the 'INPUT' menu.
3.4.2. *.TXT FILE FORMAT
When selecting this fileformat, Mouse Designer will create a
file that contains a picture of the mouse arrow. You can browse
this picture from within DOS by typing:
TYPE name.TXT
3.4.3. > PRN : REDIRECT TO PRINTER
Mouse Designer will send the same picture as it creates in a
*.TXT file format, to printer, with that exeption, that black
will become white and white black. The result will be a natural
mouse arrow picture on paper.
MDESIGN 1.0 Manual page 07
────────────────────────────────────────────────────────────────
C H A P T E R 4
4. COMMANDLINE OPTIONS
-------------------
MDESIGN.EXE accepts only two commandline options:
/? (or /h /H) : displays help
filename : loads a *.MOU file when starting
So, the syntax of MDESIGN.EXE could be written as:
MDESIGN [[drive:][path]filename[.MOU] | /?]
Starting MDESIGN without commandline options will start up with
a blanco grid (grid in backgroundcolor).
There should be some *.MOU files with this software. If you have
the file DEFAULT.MOU, try to start MDESIGN as:
MDESIGN default
You will then start up with the default mouse arrow.
[Please, do not modify the file DEFAULT.MOU]
MDESIGN 1.0 Manual page 08
────────────────────────────────────────────────────────────────
C H A P T E R 5
5. ADVANCED FEATURES
-----------------
Mouse Designer lets you draw your own graphical mouse arrows.
For the way to draw mouse arrows, see section 3.1.
Mouse Designer provides also some features to help you drawing
mouse arrows. The first release of Mouse Designer counts only 2
advanced features, but I am planning some more for future
releases.
5.1. MIRROR
This options turns the graphical mouse arrow vertically, as if
you looked into a mirror on a wall.
5.2. TURN 90°
This option turns the graphic 90 degrees to the left (a clock
turns to the right).
MDESIGN 1.0 Manual page 09
────────────────────────────────────────────────────────────────
C H A P T E R 6
6. USING MOUSE DESIGNER PROCEDURES
-------------------------------
The procedures created by Mouse Designer are easy to integrate
in your software. In this chapter we will see how to do it.
DON'T FORGET THAT THE MOUSE ARROW WILL ONLY GET A GRAPHICAL
SHAPE IF YOU WORK IN A GRAPHICAL VIDEOMODE.
6.1. IN QUICK-BASIC
Version: the created subroutines were tested under QuickBASIC
4.50, altough they should work in QuickBASIC 4.00 too. It will
not work under earlier versions of QuickBASIC, nor under
GW-BASIC, BASICA or QBASIC.
MDESIGN creates a subroutine that you could load as module into
your programs or include manually using the cut and paste
options of the QuickBASIC environment into your main module.
LOADING SUBROUTINE AS MODULE:
If you load the subroutine into your program as a module, you
should copy the line
DECLARE SUB MD.subname ()
to all modules that calls this subroutine.
If you cut and paste the subroutine into your main module,
you have to type in your main module this one line:
'$INCLUDE: 'QB.BI'
( │ └─────┴─ Yes, single quotes )
( └── Yes, a remark-quote )
If the file QB.BI is not found, type following line on the DOS
prompt:
DIR \QB.BI /S
DOS will now tell you where the QB.BI file is situated (if any).
Maybe you will have to unpack QB.BI from the QuickBASIC
distribution disks. You can now modify the QuickBASIC evironment
by running QuickBASIC, then typing Alt+O and then pressing E:
the INCLUDE path should point to QB.BI.
Finally, the procedure will only work if you started QuickBASIC
with the option /L, so:
QB /L
If you link your program outside the QuickBASIC environment, you
should link QB.LIB with your program.
MDESIGN 1.0 Manual page 10
────────────────────────────────────────────────────────────────
6.2. IN TURBO PASCAL
Version: The Pascal units were tested under Turbo Pascal 5.0,
Turbo Pascal 6.0 and Turbo Pascal 7.0. I do not know if they
will work with lower versions of Turbo Pascal, nor if they will
work with other Pascal compilers. Just try it out.
Using the created procedure in Turbo Pascal programs is quite
easy. Compile the file with the procedure without changing
anything to it to a TPU file (just compile the PAS file).
In the beginning of your program, you will have to insert the
line
USES filename;
where filename is the name of the created *.PAS file (and the
TPU file).
You can now call the procedure in your program without any
declaration beforehand.
6.3. IN C
Version: The C header files were tested under Turbo C. I presume
they will also work under Borland C/C++, but I don't think you
will be able to use them with Microsoft C/C++ or QuickC unless
you modify the header files...
Using the header files in your C programs is very simple. Just
add in front of your program:
#include "name.h"
You can now use freely the MD_NAME function (of type void) in
your program.
6.4. IN ASSEMBLY
Version: The assembly include files were tested under Microsoft
Macro Assembler 6.0.
You could manually include the file into your program, or -
better - use the INCLUDE statement like this:
INCLUDE name.asm
You can then call the procedure with:
call MDName
MDESIGN 1.0 Manual page 11
────────────────────────────────────────────────────────────────
The major problems you could encounter if you use another
assembler are the WORD and the PROC USES identifiers. You could
change them into:
WORD 0FFFFh, 0F87Ah,...
into DW 0FFFFh, 0F87Ah,...
and
MDName PROC USES AX BX CX DX ES
...
MDName ENDP
into MDName PROC
PUSH AX
PUSH BX
PUSH CX
PUSH DX
PUSH ES
...
POP ES
POP DX
POP CX
POP BX
POP AX
MDName ENDP ;(°)
(°) some assemblers will need 'MDname ENDP', som others only
'ENDP'.
6.5. OTHER PROGRAMMING LANGUAGES
The easiest way to use Mouse Designer's arrows into other
programming languages, is to shell to COMMAND.COM and execute
the NAME.COM instruction (mouse arrow outputed to a COM file).
(Note that the NAME.COM files will only work in graphical mode,
the COM files do not change or set the graphical mode.)
But that is certainly NOT the best way to do. The best you can
do, is to use files created for other languages (BASIC, PASCAL,
C,...) and modify them as needed.
See paragraph 8.2 for more information about how to change the
mouse arrow in graphical mode.
If you have to modify 'language-files', it could be usefull for
you to obtain the source code of Mouse Designer (if of course
you have QuickBASIC). See chapter 9 for more information about
this.
MDESIGN 1.0 Manual page 12
────────────────────────────────────────────────────────────────
C H A P T E R 7
7. DESCRIPTION OF FILE-FORMATS
---------------------------
7.1. THE *.MOU FORMAT
Mouse Designer can only read files of the *.MOU format. Programs
that can create *.MOU files are Mouse Designer and MGRAB.COM.
Every *.MOU file must be 68 bytes long. The file description is:
byte 1 : X-axis of the hot spot (0-15)
2 : 0 (MUST BE ZERO)
3 : Y-axis of the hot spot (0-15)
4 : 0 (MUST BE ZERO)
5-36 : (32 bytes) screenmask
37-68 : (32 bytes) cursormask
Each mask (screen- and cursormask) is build up of 16 words
(unsigned integers of 2 bytes), every word corresponds to one
line of the arrow-picture (the first word represents the top
line, the last word the bottom line). The 8 pixels on the left-
hand side of the picture are represented by the 2nd byte (the
low byte) of the word, where the highest bit stands for the
pixel on the left.
For more information about hot spot and screen- and cursormask,
see paragraph 8.2.
7.2. THE *.COM FORMAT
The COM file created by Mouse Designer corresponds to the
procedure-sourcecode generated for different programming
languages. So, the COM file only contains a routine to change
the shape of the mouse pointer.
And since the shape of the mouse pointer can only be changed to
a graphical picture is the screen is in gaphical mode, executing
the COM file only makes sense if your screen is in a graphical
mode. You also have to show the mouse cursor yourselve.
The results of the COM files are unpredictable if MOUSE.COM (are
any compatible mouse driver) is not installed !
MDESIGN 1.0 Manual page 13
────────────────────────────────────────────────────────────────
The COM file contains the following program:
CODE LABEL MNEMONIC
0E PUSH CS
07 POP ES ;MOV ES,segment Shape
B80900 MOV AX,0009h
BBxx00 MOV BX,hot_spot_X ;a value between 00h and 0Fh
B9xx00 MOV CX,hot_spot_Y ;a value between 00h and 0Fh
BAxxxx MOV DX,offset Shape
CD33 INT 33h
CD20 INT 20h
... Shape DW ...,...,... ;32 bytes screenmask
... DW ...,...,... ;32 bytes cursormask
For more information about hot spot and screen- and cursormask,
see paragraph 8.2.
MDESIGN 1.0 Manual page 14
────────────────────────────────────────────────────────────────
C H A P T E R 8
8. MORE ABOUT...
-------------
8.1. USING MOUSE CONTROL INTO YOUR PROGRAMS
To use mouse control in your programs, MOUSE.COM (are any
equivalent mouse driver) must be loaded.
You can check if MOUSE.COM is loaded with following statements:
VARIABLE Buttons IS AN INTEGER ;declare variable 'Buttons'
Reg.AX := 0000 ;make register AX equal to 0
INTERRUPT 33h, Reg ;call interrupt 33h
IF Reg.AX = FFFFh THEN
;MOUSE.COM loaded and active, mouse present
IF Reg.BX = FFFFh THEN
Buttons := 2
ELSE
Buttons := Reg.BX
ENDIF
ELSE
;MOUSE.COM not loaded or not active, or no mouse found
Buttons := 0
ENDIF
(Note: calling interrupt 33h with AX=0000 resets the mouse
driver, this means that the mouse arrow will become invisible
and that the mousearrow will be able to move around the whole
screen (see further: functions 07h and 08h of interrupt 33h).)
At the end of this small program, the variable Buttons will
indicate the number of buttons on the mouse. If Buttons=0 then
no mouse is connected, MOUSE.COM is not loaded or MOUSE.COM is
not active; in which case you should not try to execute the
other functions of interrupt 33h !
If MOUSE.COM is active, you can use the other functions of
interrupt 33h. These are:
FUNCTION 00H - RESET MOUSE DRIVER
Call: AX = 0000
Return: AX : 0000 if mouse driver not active
FFFF if mouse driver active
BX : number of buttons (2 or 3)
note: if BX = FFFF there are 2 buttons
This function tells you if the mouse driver is active and how
many mousebuttons there are. It also resets the mouse driver.
MDESIGN 1.0 Manual page 15
────────────────────────────────────────────────────────────────
FUNCTION 01H - SHOW MOUSE ARROW ON SCREEN
Call: AX = 0001
Return: Nothing.
This function makes the mouse arrow visible on the screen.
See also: function 02h.
FUNCTION 02H - HIDE MOUSE ARROW
Call: AX = 0002
Return: Nothing.
This function is the inverse of function 01H: it hides the
mouse arrow. You should hide the mouse arrow every time you
write something on the screen (under the mouse arrow).
Note: Multiple calls of this function will require multiple
calls of function 01h to make the mouse arrow visible
again.
See also: function 01h.
FUNCTION 03H - GET ACTUAL MOUSE STATUS
Call: AX = 0003
Return: BX : buttonstatus:
bit 0 : 1/0 left button pressed/released
bit 1 : 1/0 right button pressed/released
bit 2 : 1/0 middle button pressed/released
CX : X-position of mouse arrow
DX : Y-position of mouse arrow
This function returns the actual position of the mouse arrow
and the actual state of the mouse buttons.
Note: The X- and Y-positions does not always match the screen
coordinates. See important notice below !
See also: function 04h, 05h, 06h.
FUNCTION 04H - POSITION THE MOUSE ARROW
Call: AX = 0004
CX : X-position of mouse arrow
DX : Y-position of mouse arrow
Return: Nothing.
This function moves the mouse arrow to (CX,DX).
Note: The X- and Y-positions does not always match the screen
coordinates. See important notice below !
See also: function 04h.
FUNCTION 05H - GET STATUS LAST TIME PRESSED
Call: AX = 0005
BX : buttonnumber:
0 = left button
1 = right button
2 = middle button
Return: AX : actual buttonstatus (see function 03h)
BX : number of times specified key was pressed since
this function was last called
CX : X-position when specified button was last pressed
DX : Y-position when specified button was last pressed
This function returns the number of times button BX was
pressed since this function was last called. It also returns
the position (CX,DX) where the mouse arrow stood when the
mouse button BX was last pressed.
See also: function 03h, 06h.
MDESIGN 1.0 Manual page 16
────────────────────────────────────────────────────────────────
FUNCTION 06H - GET STATUS LAST TIME RELEASED
Call: AX = 0006
BX : buttonnumber:
0 = left button
1 = right button
2 = middle button
Return: AX : actual buttonstatus (see function 03h)
BX : number of times specified key was released since
this function was last called
CX : X-position when specified button was last
released
DX : Y-position when specified button was last
released
This function returns the number of times button BX was
released since this function was last called. It also returns
the position (CX,DX) where the mouse arrow stood when the
mouse button BX was last released.
See also: function 03h, 05h.
FUNCTION 07H - SET HORIZONTAL LIMITS
Call: AX = 0007
CX : Leftside limit
DX : Rightside limit
Return: Nothing.
With this function, you can set horizontal limits to the
movement of the mouse arrow. When this function is called, the
mouse arrow can only be moved between column CX and DX.
Note: The X- and Y-positions does not always match the screen
coordinates. See important notice below !
See also: function 08h.
FUNCTION 08H - SET VERTICAL LIMITS
Call: AX = 0008
CX : Upper limit
DX : Lower limit
Return: Nothing.
With this function, you can set vertical limits to the
movement of the mouse arrow. When this function is called, the
mouse arrow can only be moved between row CX and DX.
Note: The X- and Y-positions does not always match the screen
coordinates. See important notice below !
See also: function 07h.
FUNCTION 09H - DEFINE SHAPE OF GRAPHICAL MOUSE ARROW
Call: AX = 0009
BX : column of hot spot (0-15)
CX : row of hot spot (0-15)
ES:DX : pointer to table with screenmask and cursor-
mask (2 * 32 bytes)
Return: Nothing.
This function lets you redefine the shape of the graphical
mouse arrow.
See also: function 0Ah, paragraph 8.2 of this manual.
MDESIGN 1.0 Manual page 17
────────────────────────────────────────────────────────────────
FUNCTION 0AH - DEFINE SHAPE OF TEXTMODE MOUSE ARROW
Call: AX = 000A
BX : 0000 for software mouse arrow:
CH : screenmask attribute
CL : screenmask character
DH : cursormask attribute
DL : cursormask character
0001 for hardware mouse arrow:
CX : start scan line
DX : end scan line
Return: Nothing.
This function lets you redifine the shape of the mouse arrow
in text mode.
See also: function 09h.
...
(There are many more functions of interrupt 33h, but those above
are the most used, and are enough to write mouse controlled
programs.)
IMPORTANT NOTICE ON MOUSE COORDINATES:
When the mouse driver asks or returns screen coordinates (x and
y-axis), mostly registers CX and DX are used: CX for the x-axis
coordinate, DX for the y-axis coordinate.
These coordinates are always expressed in pixels, even when the
video display is in text mode !
For text modes, the coordinates are expressed as for a
(640x200) screen resolution (for 40x25 or 80x25 textmodes). So,
if X and Y are screen coordinates, you can switch between
screen coordinates and mouse coordinates with both following
formules: X = 1 + (CX / a)
and Y = 1 + (DX / 8)
(where a=8 for 80 column modes and a=16 for 40 column modes).
Both formules above are valid for text modes with 25, 43 50 or
60 lines.
In graphical modes, the mouse coordinates matches the screen
coordinates, except in all (320x200) screen resolution modes,
where you can use following tranformationformules:
X = CX / 2
Y = DX
8.2. DEFINING GRAPHICAL MOUSE ARROW SHAPES
Standard, the mouse arrow is - in graphical video modes - an
arrow pointing to left-up. This arrow fits in a box of 16 pixels
on 16 pixels on the screen. When we use function 09h of
interrupt 33h to redifine the mouse arrow shape (what we are
doing), we are also limited to a 16 pixels on 16 pixels lage
arrow. (Recent software mostly uses another function of
interrupt 33h so they can get larger mouse arrows.)
MDESIGN 1.0 Manual page 18
────────────────────────────────────────────────────────────────
Colored graphical mouse arrows are not (yet) supported by the
mouse driver, so we should have to rewrite some functions of the
mouse driver to use colored mouse arrows. We won't do that here.
To define a shape for the graphical mouse arrow, we use two
'masks': a screenmask and a cursormask. Each mask contains 16x16
pixels of information (so each mask is 32 bytes long). Because -
using two masks - every pixel of the mouse arrow is defined by
two bits in the masks (one in each mask), you could speak about
4 attributes.
When drawing the mouse arrow on the screen, the mouse driver
will AND the pixels on the screen with the screenmask, and then
XOR the result with the cursormask. So:
((PIXEL AND SCREENMASK) XOR CURSORMASK) = NEW PIXEL
Where PIXEL is the color of the pixel under the mouse arrow, and
NEW PIXEL is the color of that pixel of the mouse arrow, ones
the mouse arrow is drawed on the screen.
Lets use a diagram to show how the screen- and cursormask work:
PIXEL and SCREENMASK xor CURSORMASK = NEW PIXEL
any 0 0 black
any 0 1 white
any 1 0 background color
any 1 1 inversed backgr.color
So, if all bits of both masks are 0, the mouse arrow will be a
black box of 16 pixels on 16 pixels...
When calling function 09h of interrupt 33h, ES:DX must point to
an area of 64 bytes, where the 32 first bytes are the screenmask
and the 32 last bytes the cursormask.
Registers BX and CX should contain the coordinates of the hot
spot of the arrow, relative to the 16x16 pixels arrow. So, to
indicate the most left-up pixel of the mouse arrow, BX and CX
should both contain 0; to indicate the most right-bottom pixel
as hot spot, BX and CX should both contain the value 15.
When executing function 09h of interrupt 33h, the mouse driver
will make a copy of both masks into a buffer of the mouse
driver. So changing the masks ones the function is executed,
will not affect the mouse arrow on the screen.
MDESIGN 1.0 Manual page 19
────────────────────────────────────────────────────────────────
C H A P T E R 9
9. FREEWARE - SOURCECODE - UPGRADE - CONTACTING THE AUTHOR
-------------------------------------------------------
Mouse Designer is 'freeware'. This means you may freely use,
copy and distribute Mouse Designer, at 3 conditions:
1. you may not modify Mouse Designer or any of its
accompanying files,
2. you may only distribute Mouse Designer or any of its
accompanying files if you distribute all files of the
Mouse Designer package together,
3. you may not ask a fee to exceed $10 for distribution, post
and package.
Although you may use and copy Mouse Designer freely, you are
encouraged to send a fee to the author if you use it. You may
send me any fee you want, but if you send me at least US$ 15 (°)
you will get the copyrighted sourcecode of MDESIGN.EXE (written
in QuickBASIC 4.50) and MGRAB.COM (written in Microsoft Macro
Assembler 6.0) and also a free upgrade of Mouse Designer when
it's available.
The sourcecodes of MDESIGN.EXE and MGRAB.COM are NOT freeware.
These sourcecodes may NOT be distributed !
(°) or 400 BEF (Belgium & Luxembourg), ƒ 25.- (The Netherlands),
80 FF (France), 25 DM (Germany), £ 9.- (Great Britain), 12 ECU.
You could send me your fee be (international) mail order (ask
your post office), (from European countries) by EuroCheque or by
any other way you like.
You can contact the author only by mail, by writing to:
UNITED PROGRAMMERS CLUB
TAV.RUDI BREEDENRAEDT
POSTBUS 40
B-1090 BRUSSELS
BELGIUM
You may write me for any problem you have using Mouse Designer,
for idea's to ameliorate it, to tell me about bugs you found, or
for any thing else you like...
MDESIGN 1.0 Manual page 20
────────────────────────────────────────────────────────────────
C H A P T E R 1 0
10. THANKS TO...
------------
Thanks to:
- Microsoft, for providing a friendly QuickBASIC compiler and
a powerfull Macro Assembler,
- Michel Brackx and Wim Vandersmissen for beta-testing and
helping creating the 'foreign'-language procedures,
Product names are (registered) trademarks of their producers.